namespace SimpleWebServices.Web
{
    using System;
    using System.Web;
    using SimpleWebServices;
    using SimpleWebServices.Security.Principal;
    using Xunit;

    public sealed class CookieAuthenticationModuleFacts
    {
        [Fact]
        public void typedef()
        {
            Assert.True(new ObjectExpectations<CookieAuthenticationModule<TestUser>>()
                .DerivesFrom<object>()
                .IsConcreteClass()
                .IsSealed()
                .HasDefaultConstructor()
                .Implements<IHttpModule>()
                .Result);
        }

        [Fact]
        public void ctor()
        {
            Assert.NotNull(new CookieAuthenticationModule<TestUser>());
        }

        [Fact]
        public void op_Dispose()
        {
            new CookieAuthenticationModule<TestUser>().Dispose();
        }

        [Fact]
        public void op_Init_HttpApplicationNull()
        {
            Assert.Throws<ArgumentNullException>(() => new CookieAuthenticationModule<TestUser>().Init(null as HttpApplication));
        }
    }
}